import type { PropType } from 'vue';
export type TreeTab = {
	options: any[];
	selected: any | null;
};

export type TreeFieldNames = {
	text: string;
	value: string;
	children: string;
	leaf: string;
};
export const treeProps = {
	items: {
		type: Array as PropType<any[]>,
		default: () => [],
	},
	counterData: {
		type: Object,
		default: () => {},
	},
	load: {
		type: Function,
	},
	multiple: {
		type: Boolean,
		default: false,
	},
	expandedKeys: {
		type: Array as PropType<string[]>,
		default: () => [],
	},
	selectedKeys: {
		type: Array as PropType<string[]>,
		default: () => [],
	},
	showDefaultIcon: {
		type: Boolean,
		default: false,
	},
	fieldNames: {
		type: Object as PropType<TreeFieldNames>,
		default: {
			text: 'text',
			value: 'id',
			children: 'children',
			leaf: 'isLeaf',
		},
	},
};

export const treeHeaderProps = {
	items: {
		type: Array as PropType<any[]>,
		default: () => [],
	},
};

export const treeOptionsProps = {
	options: {
		type: Array as PropType<any[]>,
		default: () => [],
	},
	fieldNames: {
		type: Object as PropType<TreeFieldNames>,
		default: {
			text: 'text',
			value: 'id',
			children: 'children',
			leaf: 'isLeaf',
		},
	},
	selections: {
		type: Array as PropType<any[]>,
		default: () => [],
	},
	selected: {
		type: Object as PropType<TreeFieldNames>,
		default: () => {},
	},
	multiple: {
		type: Boolean,
		default: false,
	},
};
